package io.geekidea.boot.headquarters.service.Impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.headquarters.dto.HeadquartersExcel;
import io.geekidea.boot.headquarters.entity.Headquarters;
import io.geekidea.boot.headquarters.mapper.HeadquartersMapper;
import io.geekidea.boot.headquarters.query.HeadquartersQuery;
import io.geekidea.boot.headquarters.service.HeadquartersService;
import io.geekidea.boot.outbound.dto.OutboundExcel;
import io.geekidea.boot.outbound.query.OutboundQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class HeadquartersServiceImpl extends ServiceImpl<HeadquartersMapper, Headquarters> implements HeadquartersService {

    @Resource
    HeadquartersMapper headquartersMapper;

    @Override
    public Page<Headquarters> headquartersPage(Page<Headquarters> page, HeadquartersQuery headquartersQuery) {
        return headquartersMapper.getHeadquartersPageList(page,headquartersQuery);
    }

    @Override
    public int delById(Integer id) {
        return headquartersMapper.delById(id);
    }

    @Override
    public Headquarters getHeadquartersId(Integer id) {
        return headquartersMapper.getHeadquartersId(id);
    }

    @Override
    public List<HeadquartersExcel> getDownloadList(HeadquartersQuery headquartersQuery) {
        return headquartersMapper.getDownloadList(headquartersQuery);
    }
}
